<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>分配权限</title>
<include file="Public/header" />
<script type="text/javascript" src="__PUBLIC__/Js/jquery.validate.js"></script>
<script type="text/javascript">
    $(function(){
        $('input[name="group_id[]"]').click(function(){
            if($(this).prop('checked')){
                $(this).parents('.vmall_cle').find('input[name="rules_id[]"]').removeAttr('disabled');
				$(this).parents('.vmall_cle').find('input[name="rules_id[]"]').prop('checked','checked');
            }else{
                $(this).parents('.vmall_cle').find('input[name="rules_id[]"]').attr('disabled','disabled').removeAttr('checked');
            }
        })
        $("#myform").submit(function(){
            var _group_id=new Array();
            var _rules_id=new Array();
			var group_ids_val=new Array();
            $('input[name="group_id[]"]:checked').each(function(i){
                _group_id.push($(this).val());
				 group_ids_val.push($(this).attr("attr"));
            })
            $('input[name="rules_id[]"]:checked').each(function(i){
                _rules_id.push($(this).val());
            })
            var ids=_group_id+','+_rules_id;
            $('input[name="ids"]').val(ids);
			$('input[name="group_ids"]').val(_group_id);
			$('input[name="group_ids_val"]').val(group_ids_val);
        })
        $('input[name="group_id[]"]:checked').each(function(i){
            $(this).parents('.vmall_cle').find('input[name="rules_id[]"]').removeAttr('disabled');
        })
    })
</script>
<style type="text/css">
   .vmaal_rols .rules{
      display: inline;
      margin-right: 12px;
      line-height: 29px;
   }
   .vmaal_rols{
    width:600px;
   }
 
</style>
</head>


<body>
<div>
   
  
        <div class="list_vmall_man">
        	<div class="list_vmall_le">
            	<include file="./Apps/BoxAdmin/View/Public/adminMenu.html" />
            </div>
            <div class="list_vmall_rig">
            	<ul class="breadcrumb">
                    <li><a href="<{:U('index')}>">管理员</a> </li>
                    <li class="active">分配权限</li>
                </ul>
                <div class="list_vmall_bort">
                    <form id="myform" method="post" action="<{:U('access_add_do')}>">
                    <input name="ids" type="hidden" />
					 <input name="group_ids" type="hidden" />
					  <input name="group_ids_val" type="hidden" />
                    <input name="admin_id" type="hidden" value="<{$_GET['admin_id']}>" />
                    	<div class="vmall_padi">

                        <volist name="data" id="vo">
                            <div class="vmall_cle">
                                <label for="input-title" class="vmall_te_le" style="color:#0080FF">
                                    <label>  <input type="checkbox" name="group_id[]" attr="<{$vo.id}>" value="<{$vo.rid}>" <{$vo.checked}>  />
                                     <{$vo.title}></label>
                                </label>
                                <div class="vmaal_rols">
                                    <volist name="vo.rule" id="rule">
                                     <div class="rules">
                                      <span>
                                       <label> <input type="checkbox" disabled="disabled"  name="rules_id[]" value="<{$rule.id}>" <{$rule.checked}>><{$rule.title}></label>
                                       </span>  
                                     </div>
                                    </volist>
                                </div>
                            </div>
                        </volist>
							
                            <div class="vmall_cle">
                                <div class="vmaal_rols">
                                    <button class="v_mall_q_1" style="border:0; height:32px; padding-top:0; cursor:pointer;" type="submit">确&nbsp;&nbsp;定</button>
                                     <a class="v_mall_q_1" style="border: 0px none;height: 28px;padding-top: 0px;cursor: pointer;display: inline-block;" onclick="javascript:history.go(-1);">返&nbsp;&nbsp;回</a>
                                </div>
                            </div>

                         </div>
                     </form> 
                </div>
                
            </div>
        
        </div>
        

    
    
    
  
</div>



</body>
</html>
